package com.itheima.article.feign;

import com.itheima.article.pojo.ApAuthor;
import com.itheima.common.vo.ResultVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "leadnews-article", contextId = "apAuthorFeign")
public interface ApAuthorFeign {

    /**
     * 查询作者账号
     * @param apUserId
     * @param wmUserId
     * @return
     */
    @GetMapping("/api/ApAuthor/getByApUserId/{apUserId}/{wmUserId}")
    ResultVo<ApAuthor> getByApUserAndWmUserId(@PathVariable(value = "apUserId") Long apUserId,
                                     @PathVariable(value = "wmUserId") Long wmUserId);

    /**
     * 查询作者账号
     * @param apAuthor
     * @return
     */
    @PostMapping("/api/ApAuthor/add")
    ResultVo addApAuthor(@RequestBody ApAuthor apAuthor);
}
